
module.exports = options => {
  return async function ctxLogger(ctx, next) {
    ctx.logger.info(`--------------------------------------------
    Date: ${new Date()};
    Url: ${ctx.request.url};
    ContentType: ${JSON.stringify(ctx.request.header['content-type'])};
    Method: ${ctx.request.method};
    Query:  ${JSON.stringify(ctx.query)};
    Params: ${JSON.stringify(ctx.request.params|| {})};
    Body: ${JSON.stringify(ctx.request.body || {})};
    --------------------------------------------
    `);
    await next();
  }
}